package com.atguigu.reflect;

import com.atguigu.reflect.entity.Tiger;

public class Demo07ClassLoader {

    public static void main(String[] args) {

        // Tiger 类被加载到内存中时，使用的类加载器
        ClassLoader classLoader = Tiger.class.getClassLoader();

        // jdk.internal.loader.ClassLoaders$AppClassLoader
        System.out.println("classLoader = " + classLoader);

        // 获取父加载器
        ClassLoader platformClassloader = classLoader.getParent();

        // jdk.internal.loader.ClassLoaders$PlatformClassLoader
        System.out.println("platformClassloader = " + platformClassloader);

        // 获取平台类加载器的父加载器
        ClassLoader bootStrapClassloader = platformClassloader.getParent();

        // null：Java 环境无法获取 C/C++ 的对象
        System.out.println("bootStrapClassloader = " + bootStrapClassloader);
    }

}
